/**
 * Created by chenxi on 2017/6/13.
 */
import Vue from 'vue';
import VueResource from 'vue-resource';
import filter from '../../../assets/js/filter';
import common from '../../../assets/js/common';
import tuanDetail from './tuan-detail.vue';
import Url from 'url';
import QueryString from 'query-string';

Vue.use(VueResource);
filter(Vue);

//登录信息传输到后台
var backUrl = common.isdev()+"/user/checkLogin.htm";
var hrefUrl = window.location.href;
var urlObj = Url.parse(hrefUrl);
var queryObj = QueryString.parse(urlObj.query);
if (queryObj.userInfo) {
  backUrl = backUrl + "?userInfo=" + queryObj.userInfo;
}

var promise = Vue.http.post(backUrl).then(function(d) {
    console.info('success');
}, function(err) {
    console.info('err');
});
promise.then(function ( response ) {
	new Vue({
	    el: '#tuan-detail',
	    render: h => h(tuanDetail)
	});
    // 成功回调
});
